<script setup lang="ts">
import {
    Document,
    Menu as IconMenu,
    Location,
    Setting,
} from '@element-plus/icons-vue'
const handleOpen = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
}
const handleClose = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
}
</script>
<template>
    <div class="common-layout">
        <el-container>
            <el-header>Header</el-header>
            <el-container>
                <el-aside width="200px">
                    <el-menu :router="true" active-text-color="#ffd04b" background-color="#545c64"
                        class="el-menu-vertical-demo" default-active="2" text-color="#fff" @open="handleOpen"
                        @close="handleClose">
                        <el-sub-menu index="1">
                            <template #title>
                                <!-- <el-icon>
                                        <location />
                                    </el-icon> -->
                                <span>商品信息管理</span>
                            </template>
                            <el-menu-item index="/Admin/CommodityList">商品列表</el-menu-item>
                            <el-menu-item index="/Admin/CommodityPage">商品分页</el-menu-item>
                        </el-sub-menu>
                        <el-sub-menu index="2">
                            <template #title>
                                <span>轮播图的管理</span>
                            </template>
                            <el-menu-item index="/Admin/List">轮播图列表
                            </el-menu-item>
                            <el-menu-item index="/Admin/Add">轮播图添加</el-menu-item>
                        </el-sub-menu>
                        <el-sub-menu index="3">
                            <template #title>
                                <span>操作人员管理</span>
                            </template>
                            <el-menu-item index="/Admin/OperatorList">操作人员列表
                            </el-menu-item>
                            <el-menu-item index="/Admin/OperatorAdd">添加操作人员</el-menu-item>
                        </el-sub-menu>
                        <el-sub-menu index="4">
                            <template #title>
                                <span>地址列表管理</span>
                            </template>
                            <el-menu-item index="/Admin/Adress">地址对应列表
                            </el-menu-item>
                        </el-sub-menu>
                    </el-menu>
                </el-aside>
                <el-main>
                    <router-view></router-view>
                </el-main>
            </el-container>
        </el-container>
    </div>
</template>

<style scoped>
.el-header {
    width: 100%;
    height: 80px;
    background-color: skyblue;
    text-align: center;
    line-height: 80px;
}

.common-layout {
    width: 100%;
    height: 100%;
}

.el-container {
    height: 100%;
}

.el-aside {
    height: 100%;
    background-color: #545c64;
}

.el-main {
    width: 100%;
    height: 100%;
    background-color: cornsilk;
}
</style>
